package org.flexspeedup.blog.admin.events
{
import flash.events.Event;

import mx.events.FlexEvent;

/**
 * Defines the available actions in a <code>CollectionManagerList</code> component
 */
public class CollectionManagerEvent extends Event
{
    //--------------------------------------------------------------------------
    //
    //  Class Constants
    //
    //--------------------------------------------------------------------------
    
    //----------------------------------
    //  EDIT_SELECTED_ITEM
    //----------------------------------
    /**
     * Request edition for the selected item
     */
    public static const EDIT_SELECTED_ITEM:String = "editSelectedItem";

    //----------------------------------
    //  DELETE_SELECTED_ITEM
    //----------------------------------
    /**
     * Request deletion for the selected item
     */
    public static const DELETE_SELECTED_ITEM:String = "deleteSelectedItem";

    //----------------------------------
    //  CREATE_NEW_ITEM
    //----------------------------------
    /**
     * Request the creation of a new item
     */
    public static const CREATE_NEW_ITEM:String = "createNewItem";

    //----------------------------------
    //  NAVIGATE_TO_NEXT_PAGE
    //----------------------------------
    /**
     * Request navigation to the next page in the collection
     */
    public static const NAVIGATE_TO_NEXT_PAGE:String = "navigateToNextPage";
    
    //----------------------------------
    //  NAVIGATE_TO_PREVIOUS_PAGE
    //----------------------------------
    /**
     * Request navigation to the previous page in the collection
     */
    public static const NAVIGATE_TO_PREVIOUS_PAGE:String = "navigateToPreviousPage";
    
    //--------------------------------------------------------------------------
    //
    // Constructor
    //
    //--------------------------------------------------------------------------

    /**
     * Creates a new instance of the <code>CollectionManagerEvent</code> event 
     */    
    public function CollectionManagerEvent(type:String)
    {
        super(type, true, true);
    }
    
    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    //----------------------------------
    // selectedItem
    //----------------------------------
    /**
     * The selected item in the collection.
     */
    public var selectedItem:*;
   
    //----------------------------------
    // currentPage
    //----------------------------------
    /**
     * The page in view from the data source.
     */
    public var currentPage:int;
       
    //--------------------------------------------------------------------------
    //
    //  Overridden Methods - Event
    //
    //--------------------------------------------------------------------------

    /**
     * @inheritdoc flash.events.Event#clone
     */
    override public function clone():Event
    {
        var e:CollectionManagerEvent = new CollectionManagerEvent(type);
        e.currentPage = currentPage;
        e.selectedItem = selectedItem;
        return e;
    }
}
}